package com.chen.blue.service.system;

import com.chen.blue.domain.delete.system.UserDelete;
import com.chen.blue.domain.dto.system.UserDto;
import com.chen.blue.domain.dto.system.update.UserDtoEdit;
import com.chen.blue.domain.model.system.UsersModel;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chen.blue.domain.query.system.UserQuery;
import com.chen.blue.domain.vo.system.UserVo;
import com.chen.blue.exception.e.DtoNullException;
import com.chen.blue.result.DataResult;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * <p>
 * 用户信息表 服务类
 * </p>
 *
 * @author CLT
 * @since 2024-04-27
 */
@SuppressWarnings("all")
public interface IUsersService extends IService<UsersModel> {

    /**
     * 添加用户
     *
     * @param userDto
     * @return
     * @throws DtoNullException
     */
    boolean addUser(UserDto userDto) throws DtoNullException;

    /**
     * 删除用户
     *
     * @param userDelete
     * @return
     * @throws DtoNullException
     */
    boolean deleteUser(UserDelete userDelete) throws DtoNullException;

    /**
     * 更新用户
     *
     * @param userDtoEdit
     * @return
     * @throws DtoNullException
     */
    boolean updateUserById(UserDtoEdit userDtoEdit) throws DtoNullException;

    /**
     * 条件查询用户
     *
     * @param userQuery
     * @return
     * @throws DtoNullException
     */
    DataResult<List<UserVo>> queryUser(UserQuery userQuery) throws DtoNullException;

    /**
     * ID查询用户
     *
     * @param id
     * @return
     * @throws DtoNullException
     */
    DataResult<UserVo> queryUserById(Long id) throws DtoNullException;

    /**
     * 根据用户名判断是否存在该用户
     *
     * @param username
     * @return
     */
    boolean hasUser(String username);

    /**
     * 根据用户名查找用户
     *
     * @param username
     * @return
     */
    UsersModel getUserByUsername(String username);

    /**
     * 获取当前登录的用户信息
     *
     * @return
     */
    DataResult<Map<String, Object>> getCurrentUserInfo() throws DtoNullException;

    /**
     * 根据部门ID查询用户
     *
     * @param deptIds
     * @return
     */
    List<UsersModel> getUsersByDeptId(Set<Long> deptIds);

}
